# ==============================
# _*_ coding:utf-8 _*_
# _*_ by:zizle     _*_
# _*_ at:20230415  _*_
# ==============================
import pathlib
from app import App
from settings import FILE_STORAGE

app = App().get_app()


@app.on_event("startup")
def app_on_start():
    for folder in [pathlib.Path(FILE_STORAGE).joinpath('sysTemp/flexDataLib'),
                   pathlib.Path(FILE_STORAGE).joinpath('sysTemp/exDoctor/pdfReport')]:
        if not folder.exists():
            folder.mkdir(parents=True)
    # for route in app.routes:
    #     print(route)


if __name__ == '__main__':
    import uvicorn
    uvicorn.run(app, port=9088)